package com.mida.dms.knw.api;

import com.mida.dms.knw.entity.KnwCommonWordsTree;
import com.mida.dms.knw.vo.CommonWordsTreeDto;
import com.mida.dms.knw.vo.CommonWordsTreeVo;
import com.mida.tool.common.result.ActionResult;
import com.mida.tool.common.result.ListResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.DependsOn;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @Author: zangjian
 * @Description:
 * @Date: 2021/6/28 23:26
 * @params:
 */
@DependsOn("loadFromDatabasePropertyConfig")
//@FeignClient(name = "KnwCommonWordsTreeApi", url = "${dms.knw.feign.url}")
@FeignClient(name = "KnwCommonWordsTreeApi", url = "dms.knw.feign.url")
public interface KnwCommonWordsTreeApi {
    /**
     * 1、新增常用语
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCommonWordsTree/addCommonWordsTree",consumes =  {"application/json"})
    public ActionResult addCommonWordsTree(@RequestBody CommonWordsTreeVo commonWordsTreeVo);

    /**
     * 2、删除常用语
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCommonWordsTree/deleteCommonWordsTree",consumes = {"application/json"})
    ActionResult deleteCommonWordsTree(@RequestBody CommonWordsTreeVo commonWordsTreeVo);

    /**
     * 3、修改常用语
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCommonWordsTree/updateCommonWordsTree",consumes ={"application/json"} )
    public ActionResult updateCommonWordsTree(@RequestBody CommonWordsTreeVo commonWordsTreeVo);


    /**
     * 4、查询个人树形常用语
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCommonWordsTree/selectCommonWordsTrees",consumes = {"application/json"})
    public ListResult<List<CommonWordsTreeVo>> selectCommonWordsTrees(@RequestBody CommonWordsTreeVo commonWordsTreeVo);


    /**
     * 5、排序常用语
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCommonWordsTree/sortCommonWordsTree",consumes ={"application/json"} )
    public ActionResult sortCommonWordsTree(@RequestBody List<KnwCommonWordsTree> commonWordsTreeSoids);

    /**
     * 6、查询常用语
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCommonWordsTree/getCommonWordsTree", consumes ={"application/json"})
    ListResult<List<CommonWordsTreeVo>> getCommonWordsTree(@RequestBody CommonWordsTreeVo commonWordsTreeVo);
    /**
     * 7.1、分享和取消分享常用语
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCommonWordsTree/shareCommonWordsTrees", consumes = {"application/json"})
    public ActionResult shareCommonWordsTrees(@RequestBody CommonWordsTreeVo commonWordsTreeVo);


    /**
     * 7.1、删除时，查询当前节点下是否有常用语
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCommonWordsTree/isDelete", consumes = {"application/json"})
    public Integer isDelete(@RequestBody CommonWordsTreeVo commonWordsTreeVo);

}
